package ServerDB;

import org.hibernate.Session;
/**
 * Manager user hibernate
 * @author Guy & Liel
 *
 */
public class UserManager 
{
	private Session session = null;
	/**
	 * Contractor for manager user
	 * @param session
	 */
	public UserManager(Session session) 
	{
		if(session == null)
			throw new
			RuntimeException("Invalid session object.");
		this.session = session;
	}
	/**
	 * save user in data base
	 * @param user
	 */
	public void saveUser(User user)
	{
		session.save(user);
	}
	/**
	 * update user in data base
	 * @param user
	 */
	public void updateUser(User user)
	{
		session.update(user);
	}
	/**
	 * delete user from data base
	 * @param user
	 */
	public void deleteUser(User user) 
	{
		session.delete(user);
	}
}
